﻿
/**
\file mainfrm.h
\author Tobias Miller
\brief Definition Hauptanwendungsformular
*/

#ifndef mainfrmH
#define mainfrmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "xmlreader.h"
#include "LPComponent.h"
#include "MLDSPlayer.h"
#include "SLCommonFilter.h"
#include "SLControlCollection.h"
#include "VCL.LPControl.h"
#include "VLBasicGenericFilter.h"
#include "VLCommonDisplay.h"
#include "VLCommonFilter.h"
#include "VLDSImageDisplay.h"
#include "VLDSVideoPlayer.h"
#include "VLGenericFilter.h"
#include "MyVLGenericFilter.h"
#include <Vcl.Dialogs.hpp>

#include <Vcl.ComCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <VCLTee.TeCanvas.hpp>
#include "VLGenericFilter.h"
#include <Vcl.FileCtrl.hpp>
#include "VLCommonLogger.h"

#include "VLDSVideoLogger.h"
#include <Vcl.Imaging.jpeg.hpp>
#include "VLAVILogger.h"//---------------------------------------------------------------------------
class THauptformular : public TForm
{
__published:	// IDE-managed Components
	TVLDSVideoPlayer *videoPlayer; /*< Komponente Videoplayer */
	TVLDSImageDisplay *videoDisplay; /*< 	Komponente Bildausgabe */
	TVLGenericFilter *frameFilter; /*< Generischer Bildfilter. */
//	TMyVLGenericFilter *ptFrameFilter; /*< Generischer Bildfilter. */

	// GUI - Elemente
    TButton *playPauseButton;
	TButton *onOffButton;
	TTrackBar *lineWidthTrackBar;
	TImage *warningSymbol;
	TLabel *lineWidthDisplay;
	TFileListBox *videoListBox;

	TOpenDialog *OpenDialog1;
	TVLDSVideoLogger *videoLogger;
	TCheckBox *doRecord;


/**
\author Tobias Miller
\brief Implementation Callbackfunktion Bildmanipulationsfilters.

Holt abhänigig von der Bildnummer einen Linen-Datensatz aus XMl-Datei
und zeichnet diese in das aktuelle Frame.
*/
	void __fastcall frameFilterProcessData(	TObject *Sender,
												TVLCVideoBuffer InBuffer,
												TVLCVideoBuffer &OutBuffer,
												bool &SendOutputData);

/**
\author Tobias Miller
\brief Implementation Callbackfunktion Start des Bildmanipulationsfilters.

Aufnahme-Checkbox ausgrauen
*/
	void __fastcall frameFilterStart(	TObject *Sender,
										int &AWidth, int &AHeight,
										float SampleRate);

/**
\author Tobias Miller
\brief Implementation Callbackfunktion stoppen des Bildmanipulationsfilters.

Aufnahme-Checkbox aktivieren
*/
	void __fastcall frameFilterStop(TObject *Sender);

	// GUI - Callbackfunktionen
    void __fastcall lineWidthTrackBarChange(TObject *Sender);
	void __fastcall playPauseButtonClick(TObject *Sender);
	void __fastcall onOffButtonClick(TObject *Sender);
	void __fastcall videoListBoxOnDblCLick(TObject *Sender);
	void __fastcall videoOnStop(TObject *Sender);
	void __fastcall videoOnReset(TObject *Sender);


private:	// User declarations
	XmlReader 	tXmlParser;		/*< Zugriff auf XML-Datei*/
	TVLBitmap*	ptTmpBitmap;	/*< Temporäres Bitmap*/
	OffsideLine tLine;			/*< Abseitsline*/
	bool		bDrawLine;       /*< Line zeichnen?*/
	bool		bXmlEof;		/*< Dateoemde?*/
	bool		bLineDrawable;   /*< Datensätze vorhanden?*/
public:		// User declarations
	__fastcall THauptformular(TComponent* Owner);
	virtual __fastcall ~THauptformular();
};
//---------------------------------------------------------------------------
extern PACKAGE THauptformular *Hauptformular;
//---------------------------------------------------------------------------
#endif
